<template>
	<div>
		<comment-box :id="this.id"></comment-box>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui'
	import comment from '../subcomponents/comment.vue'
	export default {
		data() {
			return {
				id: this.$route.params.index,
				goodsinfo:{}
			}
		},
		created() {
			this.getGoodsInfo();
		},
		methods: {
			getGoodsInfo() {
				this.$http.get('data.php').then(result => {
					if(result.body.status == true) {
						this.goodsinfo = result.body.goods[this.id];
//						console.log(this.goodsinfo);
					} else {
						Toast('获取商品图文信息失败...');
					}
				})
			},
		},
		components:{
			"comment-box":comment
		}
	}
</script>

<style>
</style>